<style lang="less" scoped>
  #form:first-child {
    padding-right: 20px;
  }
</style>

<template>
  <Form id="form" v-model="formItem" :label-width="100">
    <Row>
      <!-- <Row> -->
        <!-- 课程 -->
        <Col span="12" v-show="isCourse">
          <FormItem label="课程名:" >
              <i-Input v-model="formItem.courseName" placeholder="请输入课程名" ></i-Input>
          </FormItem>
        </Col>
        <Col span="12" v-show="isCourse">
          <FormItem label="描述:">
            <Input v-model="formItem.courseDesc" type="textarea" placeholder="请输入课程描述"></Input>
          </FormItem>
        </col>
        <!-- 专业 -->
        <Col span="12" v-show="isCourse == false">
          <FormItem label="专业名:" >
              <i-Input v-model="formItem.proName" placeholder="请输入专业名" ></i-Input>
          </FormItem>
        </Col>
        <Col span="12" v-show="isCourse == false">
          <FormItem label="描述:">
            <Input v-model="formItem.proDesc" type="textarea" placeholder="请输入专业描述"></Input>
          </FormItem>
        </col>
        <Col span="12" v-show="formItem.readOnly">
            <FormItem label="创建日期:">
              <DatePicker type="date" placeholder="请选择创建日期" v-model="formItem.createdAt"></DatePicker>
          </FormItem>
        </col>
      <!-- </Row>
      <Row> -->
        <Col span="12" v-show="formItem.readOnly">
            <FormItem label="修改日期:">
              <DatePicker type="date" placeholder="请选择修改日期" v-model="formItem.updateAt"></DatePicker>
          </FormItem>
        </col>
    </Row>
  </Form>
</template>

<script>
import httpUtil from '@/libs/httpUtil'

export default {
  name: 'AddUpdate',
  // props: ['row','isCourse'], // 表单数据
  props: {
    row: {
      type: Object,
      required: true
    },
    isCourse: {
      type: Boolean,
      default: false,
      required: true
    }
  },

  data () {
    return {
      // 表单数据
      formItem: {}
    }
  },
  methods: {

  },
  watch: {
    row (v) {
      this.formItem = v
    }
    // isCourse(v){
    //   this.isCourseTemp = v
    // }
  }
}
</script>
